package mongohelper.impl;

import java.util.List;

import mongohelper.MongoConnection;

import com.mongodb.DBCollection;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions;
import com.mongodb.MongoCredential;
import com.mongodb.MongoException;
import com.mongodb.ServerAddress;

public class MongoConnectionImpl implements MongoConnection {

	private MongoClient client;

	public MongoConnectionImpl(ServerAddress address,
			List<MongoCredential> credentials, MongoClientOptions options) {
		client = new MongoClient(address, credentials, options);
	}

	public DBCollection getCollection(String database, String collection)
			throws MongoException {
		return client.getDB(database).getCollection(collection);
	}

}
